<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

/*Route::get('CLTPHP', function () {
    return 'hello,CLTPHP!';
});*/
/*Route::POST('apply_<name>', '/home/ApplyApiController/apply_:name')
->pattern(['t' => '\w+', 'r' => '\w+', 's' => '\w+']);*/
//return [
//    '/index/'=>'home/index/index', //首页
//];

header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:*');
header('Access-Control-Allow-Headers:*');
header('Access-Control-Allow-Credentials:false');

Route::group('/v1', function () {
    Route::post('/register', 'MemberController/register'); // 用户注册
    Route::post('/login', 'MemberController/login'); // 用户登录
    Route::post('/getMemberInfo', 'MemberController/getMemberInfo'); // 获取用户信息
    Route::post('/saveStoreInfo', 'StoreController/save'); // 设置道馆信息：增加/修改
    Route::post('/getStoreInfo', 'StoreController/getInfo'); // 获取道馆信息
    Route::post('/saveMemberInfo', 'MemberController/save'); // 设置用户信息：增加/修改
    Route::post('/getProvinceList', 'CityController/getProvinceList'); // 获取省列表
    Route::post('/getMessageList', 'MessageController/getList'); // 获取消息列表
    Route::post('/getMessageInfo', 'MessageController/getInfo'); // 获取消息详情
    Route::post('/getCityChildList', 'CityController/getChild'); // 获取城市/区域列表
    Route::post('/searchStoreList', 'StoreController/searchStoreList'); // 根据省、市、关键字搜索拳馆列表
    Route::post('/getCoachListByStoreId', 'MemberController/getCoachListByStoreId'); // 获取当前拳馆下面的所有教练
    Route::post('/studentBindCoach', 'MemberController/studentBindCoach'); // 学员绑定教练
    Route::post('/studentBindInstrument', 'InstrumentController/bind'); // 学员绑定设备
    Route::post('/studentGetTaskList', 'TaskController/studentGetTaskList'); // 学生获取任务列表
    Route::post('/saveTask', 'TaskController/save'); // 教练发布任务
    Route::post('/coachGetTaskList', 'TaskController/coachGetTaskList'); // 教练获取自己发布任务的列表
    Route::post('/curatorGetTaskList', 'TaskController/curatorGetTaskList'); // 馆长获取自己拳馆的任务列表
    Route::post('/curatorGetStoreList', 'StoreController/curatorGetStoreList'); // 馆长获取自己的道馆列表
    Route::post('/getStudentList', 'MemberController/getStudentList'); // 馆长和教练获取自己的学cc员列表
    Route::post('/checkIn', 'CheckInController/check'); // 打卡/签到
    Route::post('/getCheckDays', 'CheckInController/getCheckDays'); // 查询学生连续签到次数
    Route::post('/getCheckList', 'CheckInController/getCheckList'); // 获取当前学生的打卡列表
    Route::post('/uploadFile', 'FileController/upload'); // 文件上传
    Route::post('/coachGetTaskOverList', 'TaskController/coachGetTaskOverList'); // 教练查看自己本周发布任务的完成情况
    Route::post('/getRankingList', 'TaskController/getRankingList'); // 学生查看排行榜情况
    Route::post('/curatorGetTaskOverList', 'TaskController/curatorGetTaskOverList'); // 馆长查看自己道馆本周发布任务的完成情况
    Route::post('/studentOverTask', 'TaskController/studentOverTask'); // 学员完成任务接口
    Route::post('/studentGetTaskCompleteNum', 'TaskController/studentGetTaskCompleteNum'); // 学员获取任务完成进度接口
    Route::post('/systemInfo', 'SystemController/info'); // 获取系统信息接口
    // @TODO 初始化签到表数据（上线执行一次）
    Route::get('/initCheckDate', 'CheckInController/initCheckDate'); // 初始化签到表数据（上线执行一次）
});

/*Route::group('apply', function(){
    Route::any(':num','demo2');
    Route::any(':str','demo3');
    Route::any(':bool','demo4' );
},
['method'=>'get|post','ext'=>'ps','prefix'=>'index/Index/'],
['num' => '\d{2,4}' , 'str' => '[a-zA-Z]' , 'bool' => '0|1' ]);*/
